function merge_gould_met1m(last_yd)
% merge_gould_met1m(last_yd) adds new daily JGOFS 
% data in jg0yd.mat up through last_yd to the 
% existing combined gould_met1m.mat file. assumes
% sst has already been edited and stored as sstn.
% used after start_gould_met1m(first_yd) has been
% run to start gould_met1m file.
% 4/11/01

% get existing data
load gould_met1m
first_yd=ceil(max(t));
% make arrays
soparm=sopar;
tm=t;wsm=ws;wdm=wd;rhm=rh;atm=at;sstm=sst;sstnm=sstn;
xm=x;ym=y;swm=sw;lwm=lw;sogm=sog;gyrom=gyro;
bpm=bp;zm=z;sssm=sss;

for ydn=first_yd:last_yd;
   if ydn<100
      filnam=['jg0',int2str(ydn)];
      eval(['load ',filnam]);
   end
   if ydn>=100
      filnam=['jg',int2str(ydn)];
      eval(['load ',filnam]);
   end
   tm=[tm;t];
   xm=[xm;x];
   ym=[ym;y];
   sogm=[sogm;sog];
   gyrom=[gyrom;gyro];
   zm=[zm;z];
   wsm=[wsm;ws];
   wdm=[wdm;wd];
   rhm=[rhm;rh];
   atm=[atm;at];
   sstm=[sstm;sst];
   sstnm=[sstnm;sstn];
   bpm=[bpm;bp];
   swm=[swm;sw];
   lwm=[lwm;lw];
   soparm=[soparm;sopar];
   sssm=[sssm;sss];
   disp(ydn)   
end

% rename
sopar=soparm;
t=tm;ws=wsm;wd=wdm;rh=rhm;at=atm;sst=sstm;sstn=sstnm;
x=xm;y=ym;sw=swm;lw=lwm;sog=sogm;gyro=gyrom;
bp=bpm;z=zm;sss=sssm;

save gould_met1m sopar t ws wd rh at sst sstn x y sw lw sog gyro bp z sss 
clear
